<script setup lang="ts" name="LoveTalk">
import axios from 'axios'
import {nanoid} from "nanoid";
import {useLoveTalk} from "@/store/loveTalk";
const loveTalkStore = useLoveTalk()
async function getLoveTalk (){
  //   try {
  //   let {data:{content:title}} =await axios.get('https://api.uomg.com/api/rand.qinghua?format=json')
  //   let obj = {id:nanoid(),title}
  //   talkList.unshift(obj)
  // }catch (e) {
  //
  // }
}
</script>

<template>
  <div class="talk">
    <button @click="getLoveTalk">点击获取一句土味情话</button>
    <ul>
      <li v-for="item in loveTalkStore.talkList" :key="item.id">{{item.title}}</li>
    </ul>
  </div>
</template>

<style scoped>
  .talk{
    background: orange;
    padding: 20px;
    box-shadow: 0 0 10px;
    border-radius: 10px;
  }
</style>